﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ThreadManager.cs" company="">
//   
// </copyright>
// <summary>
//   Defines the ThreadManager type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace DbDiff.WinClient.Helper
{
    /// <summary>
    /// </summary>
    public class ThreadManager 
    {
        protected FormThread _formThread;
        protected WorkerThreadBase _workerThread;

        #region Constructors
        public ThreadManager (FormThread formThread, WorkerThreadBase workerThread) 
        {
            _formThread = formThread;
            _workerThread = workerThread;
        }
        #endregion Constructors

        public virtual void Start() 
        {
            //BUGBUG
            //_formThread.Thread.Start();
            _workerThread.Thread.Start();

            _workerThread.Thread.Join();
            //BUGBUG
            //_formThread.Hide();
        }
        public virtual void Cancel() 
        {
            _workerThread.Cancel();
            _formThread.Cancel();
        }

    
        #region Eseménykezelők
        public void OnStart(string[] parameters) 
        {
        }
        public void OnFinish(string[] parameters) 
        {
        }
        public void OnFailed(string[] parameters) 
        {
        }
        public void OnSuccess(string[] parameters) 
        {
        }
        #endregion Eseménykezelők
    }
}